﻿<?php
require_once('db.php');

function load_adList()
{
	$query = mysql_query('SELECT * FROM Stancja');
   
    $adList = '<ul class="list">';
    while ($row=mysql_fetch_array($query))
    {
		$adList .= '<li><a>';
        $adList .= '<span class="adId visuallyhidden">'	.$row['Id'].			'</span>';
		$adList .= '<h2>'								.$row['Tytul'].			'</h2>';
		$adList .= '<span class="streetName">'			.$row['Adres'].			'</span>';
		$adList .= '<span class="priceLimit">'			.$row['Cena'].			' zł</span>';
        $adList .= '<span class="addDate">'				.$row['Data_dodania'].	'</span>';
		$adList .= '</a></li>';
    }
	$adList .= '</ul>';
    return $adList; 
}

echo load_adList();
?>